package com.dragon.modules.yuegou.query.product;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.product.LimitSalesEntity;
import com.dragon.modules.yuegou.enums.product.LimitSalesStatus;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 限时折扣信息表 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-09-24 10:22:32
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class LimitSalesQuery extends LimitSalesEntity implements Query<LimitSalesEntity> {

	/**搜索关键字*/
	private String searchKey;
	/**排序方式：1 按折扣；2：按创建时间 */
	private Integer orderByType;
	/**商品类目ID*/
	private String categoryId;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 活动名称查询条件 */
	@JsonUnwrapped(prefix = "title")
	private Condition<String> titleCondition;

    /** 商圈ID查询条件 */
	@JsonUnwrapped(prefix = "busdId")
	private Condition<String> busdIdCondition;

    /** 商户ID查询条件 */
	@JsonUnwrapped(prefix = "merchantId")
	private Condition<String> merchantIdCondition;

    /** 商品ID查询条件 */
	@JsonUnwrapped(prefix = "spuId")
	private Condition<String> spuIdCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "skuId")
	private Condition<String> skuIdCondition;

    /** 开始时间查询条件 */
	@JsonUnwrapped(prefix = "beginDate")
	private Condition<LocalDateTime> beginDateCondition;

    /** 结束时间查询条件 */
	@JsonUnwrapped(prefix = "endDate")
	private Condition<LocalDateTime> endDateCondition;

    /** 折扣查询条件 */
	@JsonUnwrapped(prefix = "discount")
	private Condition<BigDecimal> discountCondition;

    /** 折扣金额查询条件 */
	@JsonUnwrapped(prefix = "discountFee")
	private Condition<BigDecimal> discountFeeCondition;

    /** [枚举]活动状态：0-可用-NORMAL、1-禁用-DISABLE查询条件 */
	@JsonUnwrapped(prefix = "status")
	private Condition<LimitSalesStatus> statusCondition;

    /** 活动说明查询条件 */
	@JsonUnwrapped(prefix = "remarks")
	private Condition<String> remarksCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "modifiedBy")
	private Condition<String> modifiedByCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "delBy")
	private Condition<String> delByCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;

	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}

	public String getSearchKey() {
		return searchKey;
	}

	public void setSearchKey(String searchKey) {
		this.searchKey = searchKey;
	}

	public Integer getOrderByType() {
		return orderByType;
	}

	public void setOrderByType(Integer orderByType) {
		this.orderByType = orderByType;
	}

	/**
	 * 构造一个查询条件对象
	 */
	public LimitSalesQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public LimitSalesQuery(LimitSalesEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public LimitSalesQuery(LimitSalesQuery other) {
		super(other);
		if (other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if (other.titleCondition != null) {
			this.titleCondition = other.titleCondition.copy();
		}
		if (other.busdIdCondition != null) {
			this.busdIdCondition = other.busdIdCondition.copy();
		}
		if (other.merchantIdCondition != null) {
			this.merchantIdCondition = other.merchantIdCondition.copy();
		}
		if (other.spuIdCondition != null) {
			this.spuIdCondition = other.spuIdCondition.copy();
		}
		if (other.skuIdCondition != null) {
			this.skuIdCondition = other.skuIdCondition.copy();
		}
		if (other.beginDateCondition != null) {
			this.beginDateCondition = other.beginDateCondition.copy();
		}
		if (other.endDateCondition != null) {
			this.endDateCondition = other.endDateCondition.copy();
		}
		if (other.discountCondition != null) {
			this.discountCondition = other.discountCondition.copy();
		}
		if (other.discountFeeCondition != null) {
			this.discountFeeCondition = other.discountFeeCondition.copy();
		}
		if (other.statusCondition != null) {
			this.statusCondition = other.statusCondition.copy();
		}
		if (other.remarksCondition != null) {
			this.remarksCondition = other.remarksCondition.copy();
		}
		if (other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if (other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		this.setOther(other);
	}

	private void setOther(LimitSalesQuery other){
		if(other.modifiedByCondition != null) {
			this.modifiedByCondition = other.modifiedByCondition.copy();
		}
		if(other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
		if(other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		if(other.delByCondition != null) {
			this.delByCondition = other.delByCondition.copy();
		}
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<LimitSalesEntity> toQueryWrapper() {
		QueryWrapper<LimitSalesEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (titleCondition != null) {
			titleCondition.toWrapper(wrapper, COL_TITLE);
		}
		if (busdIdCondition != null) {
			busdIdCondition.toWrapper(wrapper, COL_BUSD_ID);
		}
		if (merchantIdCondition != null) {
			merchantIdCondition.toWrapper(wrapper, COL_MERCHANT_ID);
		}
		if (spuIdCondition != null) {
			spuIdCondition.toWrapper(wrapper, COL_SPU_ID);
		}
		if (skuIdCondition != null) {
			skuIdCondition.toWrapper(wrapper, COL_SKU_ID);
		}
		if (beginDateCondition != null) {
			beginDateCondition.toWrapper(wrapper, COL_BEGIN_DATE);
		}
		if (endDateCondition != null) {
			endDateCondition.toWrapper(wrapper, COL_END_DATE);
		}
		if (discountCondition != null) {
			discountCondition.toWrapper(wrapper, COL_DISCOUNT);
		}
		if (discountFeeCondition != null) {
			discountFeeCondition.toWrapper(wrapper, COL_DISCOUNT_FEE);
		}
		if (statusCondition != null) {
			statusCondition.toWrapper(wrapper, COL_STATUS);
		}
		if (remarksCondition != null) {
			remarksCondition.toWrapper(wrapper, COL_REMARKS);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		return getQueryWrapper(wrapper);
	}

	private QueryWrapper<LimitSalesEntity> getQueryWrapper(QueryWrapper<LimitSalesEntity> wrapper){
		if (modifiedByCondition != null) {
			modifiedByCondition.toWrapper(wrapper, COL_MODIFIED_BY);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		if (delByCondition != null) {
			delByCondition.toWrapper(wrapper, COL_DEL_BY);
		}
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回活动名称查询条件
	 * 
	 * @return titleCondition 活动名称查询条件
	 */
	public Condition<String> title() {
		this.titleCondition = new Condition<>();
		return this.titleCondition;
	}
	
	/**
	 * 获取活动名称查询条件
	 * 
	 * @return titleCondition 活动名称查询条件
	 */
	public Condition<String> getTitleCondition() {
		return titleCondition;
	}

	/**
	 * 设置活动名称查询条件
	 * 
	 * @param titleCondition 活动名称查询条件
	 */
	public void setTitleCondition(Condition<String> titleCondition) {
		this.titleCondition = titleCondition;
	}

	/**
	 * 构造并返回商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> busdId() {
		this.busdIdCondition = new Condition<>();
		return this.busdIdCondition;
	}
	
	/**
	 * 获取商圈ID查询条件
	 * 
	 * @return busdIdCondition 商圈ID查询条件
	 */
	public Condition<String> getBusdIdCondition() {
		return busdIdCondition;
	}

	/**
	 * 设置商圈ID查询条件
	 * 
	 * @param busdIdCondition 商圈ID查询条件
	 */
	public void setBusdIdCondition(Condition<String> busdIdCondition) {
		this.busdIdCondition = busdIdCondition;
	}

	/**
	 * 构造并返回商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> merchantId() {
		this.merchantIdCondition = new Condition<>();
		return this.merchantIdCondition;
	}
	
	/**
	 * 获取商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> getMerchantIdCondition() {
		return merchantIdCondition;
	}

	/**
	 * 设置商户ID查询条件
	 * 
	 * @param merchantIdCondition 商户ID查询条件
	 */
	public void setMerchantIdCondition(Condition<String> merchantIdCondition) {
		this.merchantIdCondition = merchantIdCondition;
	}

	/**
	 * 构造并返回商品ID查询条件
	 * 
	 * @return spuIdCondition 商品ID查询条件
	 */
	public Condition<String> spuId() {
		this.spuIdCondition = new Condition<>();
		return this.spuIdCondition;
	}
	
	/**
	 * 获取商品ID查询条件
	 * 
	 * @return spuIdCondition 商品ID查询条件
	 */
	public Condition<String> getSpuIdCondition() {
		return spuIdCondition;
	}

	/**
	 * 设置商品ID查询条件
	 * 
	 * @param spuIdCondition 商品ID查询条件
	 */
	public void setSpuIdCondition(Condition<String> spuIdCondition) {
		this.spuIdCondition = spuIdCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return skuIdCondition 查询条件
	 */
	public Condition<String> skuId() {
		this.skuIdCondition = new Condition<>();
		return this.skuIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return skuIdCondition 查询条件
	 */
	public Condition<String> getSkuIdCondition() {
		return skuIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param skuIdCondition 查询条件
	 */
	public void setSkuIdCondition(Condition<String> skuIdCondition) {
		this.skuIdCondition = skuIdCondition;
	}

	/**
	 * 构造并返回开始时间查询条件
	 * 
	 * @return beginDateCondition 开始时间查询条件
	 */
	public Condition<LocalDateTime> beginDate() {
		this.beginDateCondition = new Condition<>();
		return this.beginDateCondition;
	}
	
	/**
	 * 获取开始时间查询条件
	 * 
	 * @return beginDateCondition 开始时间查询条件
	 */
	public Condition<LocalDateTime> getBeginDateCondition() {
		return beginDateCondition;
	}

	/**
	 * 设置开始时间查询条件
	 * 
	 * @param beginDateCondition 开始时间查询条件
	 */
	public void setBeginDateCondition(Condition<LocalDateTime> beginDateCondition) {
		this.beginDateCondition = beginDateCondition;
	}

	/**
	 * 构造并返回结束时间查询条件
	 * 
	 * @return endDateCondition 结束时间查询条件
	 */
	public Condition<LocalDateTime> endDate() {
		this.endDateCondition = new Condition<>();
		return this.endDateCondition;
	}
	
	/**
	 * 获取结束时间查询条件
	 * 
	 * @return endDateCondition 结束时间查询条件
	 */
	public Condition<LocalDateTime> getEndDateCondition() {
		return endDateCondition;
	}

	/**
	 * 设置结束时间查询条件
	 * 
	 * @param endDateCondition 结束时间查询条件
	 */
	public void setEndDateCondition(Condition<LocalDateTime> endDateCondition) {
		this.endDateCondition = endDateCondition;
	}

	/**
	 * 构造并返回折扣查询条件
	 * 
	 * @return discountCondition 折扣查询条件
	 */
	public Condition<BigDecimal> discount() {
		this.discountCondition = new Condition<>();
		return this.discountCondition;
	}
	
	/**
	 * 获取折扣查询条件
	 * 
	 * @return discountCondition 折扣查询条件
	 */
	public Condition<BigDecimal> getDiscountCondition() {
		return discountCondition;
	}

	/**
	 * 设置折扣查询条件
	 * 
	 * @param discountCondition 折扣查询条件
	 */
	public void setDiscountCondition(Condition<BigDecimal> discountCondition) {
		this.discountCondition = discountCondition;
	}

	/**
	 * 构造并返回折扣金额查询条件
	 * 
	 * @return discountFeeCondition 折扣金额查询条件
	 */
	public Condition<BigDecimal> discountFee() {
		this.discountFeeCondition = new Condition<>();
		return this.discountFeeCondition;
	}
	
	/**
	 * 获取折扣金额查询条件
	 * 
	 * @return discountFeeCondition 折扣金额查询条件
	 */
	public Condition<BigDecimal> getDiscountFeeCondition() {
		return discountFeeCondition;
	}

	/**
	 * 设置折扣金额查询条件
	 * 
	 * @param discountFeeCondition 折扣金额查询条件
	 */
	public void setDiscountFeeCondition(Condition<BigDecimal> discountFeeCondition) {
		this.discountFeeCondition = discountFeeCondition;
	}

	/**
	 * 构造并返回[枚举]活动状态：0-可用-NORMAL、1-禁用-DISABLE查询条件
	 * 
	 * @return statusCondition [枚举]活动状态：0-可用-NORMAL、1-禁用-DISABLE查询条件
	 */
	public Condition<LimitSalesStatus> status() {
		this.statusCondition = new Condition<>();
		return this.statusCondition;
	}
	
	/**
	 * 获取[枚举]活动状态：0-可用-NORMAL、1-禁用-DISABLE查询条件
	 * 
	 * @return statusCondition [枚举]活动状态：0-可用-NORMAL、1-禁用-DISABLE查询条件
	 */
	public Condition<LimitSalesStatus> getStatusCondition() {
		return statusCondition;
	}

	/**
	 * 设置[枚举]活动状态：0-可用-NORMAL、1-禁用-DISABLE查询条件
	 * 
	 * @param statusCondition [枚举]活动状态：0-可用-NORMAL、1-禁用-DISABLE查询条件
	 */
	public void setStatusCondition(Condition<LimitSalesStatus> statusCondition) {
		this.statusCondition = statusCondition;
	}

	/**
	 * 构造并返回活动说明查询条件
	 * 
	 * @return remarksCondition 活动说明查询条件
	 */
	public Condition<String> remarks() {
		this.remarksCondition = new Condition<>();
		return this.remarksCondition;
	}
	
	/**
	 * 获取活动说明查询条件
	 * 
	 * @return remarksCondition 活动说明查询条件
	 */
	public Condition<String> getRemarksCondition() {
		return remarksCondition;
	}

	/**
	 * 设置活动说明查询条件
	 * 
	 * @param remarksCondition 活动说明查询条件
	 */
	public void setRemarksCondition(Condition<String> remarksCondition) {
		this.remarksCondition = remarksCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdByCondition 查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdTimeCondition 查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return modifiedByCondition 查询条件
	 */
	public Condition<String> modifiedBy() {
		this.modifiedByCondition = new Condition<>();
		return this.modifiedByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return modifiedByCondition 查询条件
	 */
	public Condition<String> getModifiedByCondition() {
		return modifiedByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param modifiedByCondition 查询条件
	 */
	public void setModifiedByCondition(Condition<String> modifiedByCondition) {
		this.modifiedByCondition = modifiedByCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return modifiedTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return modifiedTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param modifiedTimeCondition 查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return delCondition 查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return delCondition 查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param delCondition 查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return delByCondition 查询条件
	 */
	public Condition<String> delBy() {
		this.delByCondition = new Condition<>();
		return this.delByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return delByCondition 查询条件
	 */
	public Condition<String> getDelByCondition() {
		return delByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param delByCondition 查询条件
	 */
	public void setDelByCondition(Condition<String> delByCondition) {
		this.delByCondition = delByCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return delTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return delTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param delTimeCondition 查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}

}
